from sam import import_txt_path
from sam.util.fileUtil2 import read_file, write_file_quick


def convert():
    lines = read_file(import_txt_path)
    new_lines = [['用户昵称', '评论']]
    for line in lines:
        if line:
            new_line = line.replace(",", "，")
            new_line = new_line.replace("\n", "")
            new_line = new_line.replace("：", ":")
            new_line_ = new_line.split(":")
            new_lines.append(new_line_)

    file_name = "心目中最理想的大学生活(评论)"
    write_file_quick(data_list=new_lines, export_file_name=f"{file_name}",
                     optional="cover")
    print("end")


if __name__ == "__main__":
    convert()
